package builder;

import java.util.Vector;

import model.Action;

public class IteratorBuilder extends AbstractPatternBuilder {

	private String aggregate = "Aggregate";
	private String client = "Client";
	private String iterator = "Iterator";
	private String concreteAggregate = "ConcreteAggregate";
	private String concreteIterator = "ConcreteIterator";
	
	public IteratorBuilder() {
		super();
	}

	@Override
	public Vector<Action> buildPattern() {
		
		this.buildClass(client);
		this.buildClass(concreteAggregate);
		this.buildClass(concreteIterator);
		
		this.buildAbstractClass(aggregate);
		this.buildAbstractClass(iterator);
		
		this.buildDependency(concreteAggregate, concreteIterator);
		
		this.buildGeneralization(concreteAggregate, aggregate);
		this.buildGeneralization(concreteIterator, iterator);
		
		this.buildAssociation(client, aggregate);
		this.buildAssociation(client, iterator);
		this.buildAssociation(concreteIterator, concreteAggregate);

		
		return patternActions;
	}

	@Override
	public void changeNames() {

		aggregate = names.get(0);
		client = names.get(1);
		iterator = names.get(2);
		concreteAggregate = names.get(3);
		concreteIterator = names.get(4);
		
	}
	
	@Override
	public int cantUMLElements() {
		return 5;
	}

}
